package net.neptech.model.schedule;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.neptech.utils.SnowflakeIdGenerator;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author 谢辉
 * @Date 2025/8/13 14:47
 * @Description 排班设置表
 **/

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "sche_setting")
public class ScheSetting implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @GenericGenerator(name = "snowflake", type = SnowflakeIdGenerator.class)
    @GeneratedValue(generator = "snowflake")
    @Column(name = "setting_id", nullable = false)
    private Long settingId; // 排班设置ID

    @Column(name = "setting_name", length = 50)
    private String settingName; // 排班设置名称

    @JdbcTypeCode(SqlTypes.JSON)
    @Column(name = "periodic_content")
    private Object periodicContent; // 周期内容

    @Column(name = "dept_id")
    private Long deptId ; // 所属科室id

    @Column(name = "status")
    private Integer status = 1; // 状态(0-禁用,1-正常)

    @Column(name = "create_time")
    private Date createTime; // 创建时间

    @Column(name = "update_time")
    private Date updateTime; // 更新时间
}
